#  users/qianchuan/PycharmProject/
#  -*-     coding:  utf-8     -* 
#  @Author   : liuying
#  @FILE   : run_emotion.py
#  @Time   : 2022/2/9 17:42

from loguru import logger
from FashionShowComment.func.social_comment_emotion import SocialCommentEmotion
from FashionShowComment.func.social_content_emotion import SocialContentEmotion

if __name__ == '__main__':

    # 日志文件
    logger.add("log/file_{time}.log")
    logger.info("program running --- ")

    # # 短文本:直播弹幕/时装秀
    # sce = SocialCommentEmotion()
    # file_names = sce.get_file_name("./FashionShowComment/data/")[0]  # 获取路径下所有文件名称
    # print(file_names)
    # for i, file_name in enumerate(file_names):
    #     logger.info("----------file {} -----start------------".format(file_name))
    #     file_name = file_name.split(".")[0]
    #     # data_type = "直播弹幕"
    #     data_type = "时装秀"
    #     match_column_name = "content"
    #     date = "20220713"
    #     sce.run(file_name, match_column_name, date, data_type)

    # # # 长文本
    sce = SocialContentEmotion()
    file_names = sce.get_file_name("./FashionShowComment/data/")[0]  # 获取路径下所有文件名称
    print(file_names)
    for i, file_name in enumerate(file_names):
        logger.info("----------file {} -----start------------".format(file_name))
        file_name = file_name.split(".")[0]
        file_title = "作品标题"
        file_content = "作品内容"
        platform_name = "平台名称"
        date = "20220714"
        url = "http://192.168.3.108:8884/sentiment/social"
        sce.run(file_name, platform_name, file_title, file_content, date, url)

        logger.info("----------- file {} -----end-----------".format(file_name))
